﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class WorkTime_ViewAcountHolidays : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
            mpg.HelpHref = "";
            mpg.PageName = "年假明细查询";
            mpg.PicUrl = "";
            mpg.IntiBar();
        }
    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string strDep = dplist.SelectDepmanetId;
        if (strDep != "0" && strDep != "")
        {
            strDep = " like ('" + strDep + "%')";
        }
        else
        {
            strDep = " <> 0";
        }

        string ename = SelUser1.EmpName;
        if (ename != "0" && ename != "")
        {
            ename = " And Employees.EmpName like ('%" + ename + "%')";
        }

        Master.SetWhere("Department.DepartmentId" + strDep + ename);
        //Master.DataBind();
        GVHoliday.DataBind();
    }

    protected void GVHoliday_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            DataRowView drv = (DataRowView)e.Row.DataItem;

            ImageButton ibt = (ImageButton)e.Row.FindControl("ibdetail");

            ibt.Attributes.Add("onclick", "window.open ('GetYearHolidayDetail.aspx?uid=" + drv["EmployeeId"].ToString() + "', '休假明细', 'height=300, width=600,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=yes');return false");
            //top="+(screen.availHeight-240)/2+",left="+(screen.availWidth-400)/2);

        }
    }
}
